
var header = {
		
		
		panel: null,
		
		initialize:function(){
			var headerHtml = this.getHeaderHtml();
			
			this.panel = Ext.create('Ext.panel.Panel', {
				id: 'header',
				border: false,
				height: 50,
				html: headerHtml,
				region: 'north'
			});
		},
		
		getPanel: function() {
			return this.panel;
		},
		
		getHeaderHtml: function(){
			var html = '<img src="./images/plantilla/logo.gif" height="42px"></img>';
			html += '<span id="title">Administra tu restaurate con BIZIGASTEIZ</span>';
			html += '<span id="username"></span>';
			return html;
		},
		
		setHeaderUsername: function(){
			var oThis = this;
			var span = document.getElementById("username");
			span.onclick = function(e){oThis.createMenu(e);};
			span.innerHTML = 'Bienvenido <b>'+login.username+'</b><img class="bullet" src="./images/plantilla/bullet.gif"></img>';
		},
		
		createMenu: function(e){
			var menu = Ext.create('Ext.menu.Menu',{
				items: [{
			        text: 'Salir',
			        icon: './images/icons/session-logout.png',
			        handler: function(){
			        	window.location.reload();
			        }
			    }]
			});
			var title = document.getElementById("username");
			menu.showAt(title.offsetLeft,title.offsetHeight+2);
			
		}
};